from tortoise import fields, models


class Document(models.Model):
    id = fields.BigIntField(pk=True)
    content = fields.TextField(null=True, description="文本片段")
    category = fields.CharField(max_length=255, null=True, description="文本类别")
    created_at = fields.DatetimeField(auto_now_add=True, description="创建时间")
    update_at = fields.DatetimeField(auto_now=True, description="更新时间")
    deleted = fields.BooleanField(default=False, description="是否删除，0-未删除，1-已删除")

    class Meta:
        table = "document"
        table_description = "存储文本片段"
        indexes = [("category",),]



